<?php

try {

    ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 1);
    ini_set('error_log', dirname(dirname(__FILE__)) . '/WSB/tmp/error.log');
    ini_set('log_errors', 1);

    set_include_path(implode(PATH_SEPARATOR, array(
        realpath(dirname(__FILE__) . '/../../'),
        get_include_path(),
    )));

    // Define path to application directory
    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../WSB'));

    // Define application environment
    defined('APPLICATION_ENV')
        || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

    /** Zend_Application */
    require_once 'Zend/Application.php';
    $application = new Zend_Application(
        APPLICATION_ENV,
        APPLICATION_PATH . '/inc/application.ini'
    );
    $application->bootstrap();
    $application->run();

} catch (Exception $e) {

    echo "<br />Application Error - " . $e->getMessage();

}
